package com.turing.post.cardmanagement.util;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 制卡审批状态迁移明细
 * 
 * @author ys
 * @date 2012-12-17
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "MakeCardActionDetail")
@IdClass(MakeCardActionDetail.class)
public class MakeCardActionDetail implements Serializable {

	/**
	 * 制卡申请ID
	 */
	private BigInteger MakeCardApplyForId;
	/**
	 * 时间
	 */
	private Date ActionTime;
	/**
	 * 操作员ID
	 */
	private BigInteger operId;
	/**
	 * 初始处理状态
	 */
	private String INITIALSTATUS;
	/**
	 * 结束处理状态
	 */
	private String ENDSTATUS;
	/**
	 * 操作类型
	 */
	private String actionType;
	/**
	 * 备注
	 */
	private String remark;

	/**
	 * 业务未通过
	 */
	public final static String MAKECARDACTIONDETAIL_ACTIONTYPE_FIRSTTRIALNOPASS = "0";
	/**
	 * 业务通过
	 */
	public final static String MAKECARDACTIONDETAIL_ACTIONTYPE_FIRSTTRIALPASS = "1";
	/**
	 * 财务未通过
	 */
	public final static String MAKECARDACTIONDETAIL_ACTIONTYPE_FINALJUDGMENNOPASS = "2";
	/**
	 * 财务通过
	 */
	public final static String MAKECARDACTIONDETAIL_ACTIONTYPE_FINALJUDGMENPASS = "3";

	/**
	 * 制卡申请
	 */
	public final static String MAKECARDACTIONDETAIL_APPLY = "9";

	public MakeCardActionDetail() {

	}

	@Id
	@Column(name = "MakeCardApplyForId")
	public BigInteger getMakeCardApplyForId() {
		return MakeCardApplyForId;
	}

	public void setMakeCardApplyForId(BigInteger makeCardApplyForId) {
		MakeCardApplyForId = makeCardApplyForId;
	}

	@Id
	@Column(name = "ActionTime")
	public Date getActionTime() {
		return ActionTime;
	}

	public void setActionTime(Date actionTime) {
		this.ActionTime = actionTime;
	}

	@Column(name = "OPERID", nullable = false)
	public BigInteger getOperId() {
		return operId;
	}

	public void setOperId(BigInteger operId) {
		this.operId = operId;
	}

	@Column(name = "INITIALSTATUS")
	public String getInitialTranStatus() {
		return INITIALSTATUS;
	}

	public void setInitialTranStatus(String initialTranStatus) {
		this.INITIALSTATUS = initialTranStatus;
	}

	@Column(name = "ENDSTATUS", nullable = false)
	public String getEndTranStatus() {
		return ENDSTATUS;
	}

	public void setEndTranStatus(String endTranStatus) {
		this.ENDSTATUS = endTranStatus;
	}

	@Column(name = "ACTIONTYPE", nullable = false)
	public String getActionType() {
		return actionType;
	}

	public void setActionType(String actionType) {
		this.actionType = actionType;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((getActionTime() == null) ? 0 : getActionTime().hashCode());
		result = prime
				* result
				+ ((getMakeCardApplyForId() == null) ? 0
						: getMakeCardApplyForId().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final MakeCardActionDetail other = (MakeCardActionDetail) obj;
		if (getActionTime() == null) {
			if (other.getActionTime() != null)
				return false;
		} else if (!getActionTime().equals(other.getActionTime()))
			return false;
		if (getMakeCardApplyForId() == null) {
			if (other.getMakeCardApplyForId() != null)
				return false;
		} else if (!getMakeCardApplyForId().equals(
				other.getMakeCardApplyForId()))
			return false;
		return true;
	}

}
